# -*- coding: UTF-8 -*-
from app.settings import local_time
from . import Base, Column, Integer, String, DateTime, Boolean
from .model_mixin import ModelMixin


class PR(Base, ModelMixin):
    __tablename__ = 'example_pr'
    tid = Column(Integer, primary_key=True, nullable=False)
    pr_no = Column(String(36), default='', nullable=False)
    budget = Column(String(36), default='', nullable=False)
    name = Column(String(36), default='', nullable=False)
    price = Column(Integer, nullable=False)
    count = Column(Integer, nullable=False)
    total = Column(Integer, default=0, nullable=False)
    currency = Column(String(20), default='RMB', nullable=False)
    create_date = Column(DateTime, nullable=False, default=local_time)
    update_date = Column(DateTime, nullable=False, default=local_time, onupdate=local_time)
    mark = Column(String(32), default='', nullable=False)


work_tables = {'PR': PR}
